/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package entite;

import java.io.Serializable;
import java.util.Collection;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;

/**
 *
 * @author david.tamisier
 */
@Entity
@Table(name = "typequestionnaire", catalog = "feedbackform", schema = "")
public class TypeQuestionnaire implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "id", nullable = false)
    private Integer id;
    @Basic(optional = false)
    @Column(name = "libelle", nullable = false, length = 45)
    private String libelle;
        @OneToMany(mappedBy = "typeQuestionnaire")
    private Collection<Questionnaire> questionnaireCollection;

        /**
         *
         */
        public TypeQuestionnaire() {
    }

    /**
     *
     * @param id
     */
    public TypeQuestionnaire(Integer id) {
        this.id = id;
    }

    /**
     *
     * @param id
     * @param libelle
     */
    public TypeQuestionnaire(Integer id, String libelle) {
        this.id = id;
        this.libelle = libelle;
    }

    /**
     *
     * @return
     */
    public Integer getId() {
        return id;
    }

    /**
     *
     * @param id
     */
    public void setId(Integer id) {
        this.id = id;
    }

    /**
     *
     * @return
     */
    public String getLibelle() {
        return libelle;
    }

    /**
     *
     * @param libelle
     */
    public void setLibelle(String libelle) {
        this.libelle = libelle;
    }

    /**
     *
     * @return
     */
    public Collection<Questionnaire> getQuestionnaireCollection() {
        return questionnaireCollection;
    }

    /**
     *
     * @param questionnaireCollection
     */
    public void setQuestionnaireCollection(Collection<Questionnaire> questionnaireCollection) {
        this.questionnaireCollection = questionnaireCollection;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (id != null ? id.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof TypeQuestionnaire)) {
            return false;
        }
        TypeQuestionnaire other = (TypeQuestionnaire) object;
        if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "entite.TypeQuestionnaire[id=" + id + "]";
    }

}
